package com.bitin.common.data.config;

import com.bitin.common.data.auditing.AuditorAwareImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @Author: Mr.Lu
 * @Datetime 2024/8/13 21:48
 */
@Configuration
@EnableJpaAuditing
@EnableTransactionManagement
public class ORMConfiguration {

    @Bean
    public AuditorAwareImpl auditorAware() {
        return new AuditorAwareImpl();
    }

    @Bean
    public SnowflakeIdGenerator snowflakeIdGenerator() {
        return new SnowflakeIdGenerator();
    }
}